//
//  QSHomeMassageCell.m
//  DigitalEconomy_iOS
//
//  Created by Ding on 2020/3/18.
//  Copyright © 2020 DingC. All rights reserved.
//

#import "QSHomeMassageCell.h"

@implementation QSHomeMassageCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setDetailModel:(QSMessageDetailModel *)detailModel{
    _detailModel = detailModel;
    //类型  1亩均 2问题 3走访 4签到
    if (detailModel.type == 5) {
        self.leftImageView.image = [UIImage imageNamed:@"home_sendproblem"];
        self.problemProcessingLabel.text = @"问题上报";
    }else if(detailModel.type == 2){
        self.leftImageView.image = [UIImage imageNamed:@"home_problemdeal"];
        self.problemProcessingLabel.text = @"问题处理";
    }else if (detailModel.type == 3){
        self.leftImageView.image = [UIImage imageNamed:@"ic_message_visit"];
        self.problemProcessingLabel.text = @"企业走访";
    }else if(detailModel.type == 4){
        self.leftImageView.image = [UIImage imageNamed:@"home_signin"];
        self.problemProcessingLabel.text = @"驻企签到";
    }else{
        self.leftImageView.image = [UIImage imageNamed:@"ic_message_mujun"];
        self.problemProcessingLabel.text = @"亩均审批";
    }
    self.tipsLabel.text = [NSString stringWithFormat:@"%@, %@ ",  detailModel.title, detailModel.skipInfoApp];
    NSString *labelText = [NSDate getTimeFromTimestampWithStr:_detailModel.createTime format:@"yyyy-MM-dd HH:mm"];
    self.dateLabel.text = labelText;

    if (detailModel.isRead) {
        [self.messageImageView setImage:[UIImage imageNamed:@"ic_message_open"]];
    }else{
        [self.messageImageView setImage:[UIImage imageNamed:@"ic_message_close"]];
    }
    
}

@end
